from PyQt5.QtWidgets import QApplication, QWidget, QToolTip, QPushButton, QVBoxLayout, QMainWindow
from PyQt5.QtGui import QFont
import sys

class tooltip_application(QMainWindow):
    def __init__(self):
        super(tooltip_application, self).__init__()
        self.ui_setup()

    def ui_setup(self):
        # QToolTip.setFont(QFont('SansSerif', 12))
        # self.setToolTip("<h1>Hallo</h1> <br>World</br>")
        # self.setGeometry(300, 300, 200, 300)
        # self.setWindowTitle("为控件添加弹窗控件")

        self.btn = QPushButton("你真的要点击我吗")
        self.btn.setToolTip("不要删掉我啊")

        self.layout = QVBoxLayout()
        self.layout.addWidget(self.btn)

        self.widget = QWidget()
        self.widget.setLayout(self.layout)
        self.widget.resize(500, 500)
        self.setCentralWidget(self.widget)



if __name__ == "__main__":
    app = QApplication(sys.argv)
    tooltip = tooltip_application()
    tooltip.show()
    sys.exit(app.exec_())